import csv
from datetime import datetime
from matplotlib import pyplot as plt
filename0 = "北京市.csv"
with open(filename0, "r", encoding="utf-8") as f0:
	reader0 = csv.reader(f0)
	header_row = next(reader0)
	dates, bts = [], []
	for row in reader0:
		current_date = datetime.strptime(row[0], "%Y")
		dates.append(current_date)
		bt = float(row[7])
		bts.append(bt)
filename1 = "深圳市.csv"
with open(filename1, "r", encoding="utf-8") as f1:
	reader1 = csv.reader(f1)
	header_row = next(reader1)
	dates, sts = [], []
	for row in reader1:
		current_date = datetime.strptime(row[0], "%Y")
		dates.append(current_date)
		st = float(row[7])
		sts.append(st)
fig = plt.figure(dpi=128, figsize=(10, 6))
plt.plot(dates, bts, c="green", alpha=0.5)
plt.plot(dates, sts, c="yellow", alpha=0.5)
plt.fill_between(dates, bts, sts, facecolor="green", alpha=0.1)
title = "2000-2019 Beijing-Shenzhen"
plt.title(title, fontsize=20)
plt.xlabel("year", fontsize=16)
plt.ylabel("temperature", fontsize=16)
plt.tick_params(axis="both", which="major", labelsize=16)
plt.show()

